<?php
/**
 *@author Springlee <jslichun123@gamil.com>
 *@version  2014-6-9 下午3:24:52
 */
class  Erplog extends Basic{
	/**
	 * 
	 * Description 往日志表里面插入数据
	 * @param field_type  bare_field_name
	 * @param String $message 
	 */
	
	public static  function insert($message){
		if(strpos($message, 'sku') === 0){
			preg_match_all('/\[(.*?)\]/',$message,$matches);
			DB::insert('erp_logs',array('sku','value','userid','type','controller','action','log_time','table_name','table_id'))
			->values(array($matches[1][0],$matches[1][1],$matches[1][2],$matches[1][3],$matches[1][4],$matches[1][5],date('Y-m-d H:i:s'),$matches[1][6],$matches[1][7]))->execute('newerp');
		}
	}
	
	
	
}